package com.system.api.rbac.entity.po;

import com.baomidou.mybatisplus.annotation.TableField;
import java.util.List;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.yang.common.core.annotation.Chinese;
import org.yang.database.orm.entity.BaseModel;

import static com.system.common.constant.MessageConstant.*;

/**
 * 角色
 * @author: lslands
 * @version: 1.0
 * @create: 2024/5/19
 * @description:
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SysRole extends BaseModel {

    /**
     * 企业Id
     * @mock 0
     * @apiNote 只有两级, 首级为关联企业ID
     * @required
     */
    @NotNull(message = COMPANY_ID_EMPTY)
    private Long companyId;
    /**
     * 角色名
     * @mock 管理员
     * @required
     */
    @NotBlank(message = ROLE_NAME_EMPTY)
    private String name;
    /**
     * 角色标识
     * @mock root
     * @required
     */
    @Chinese
    @NotBlank(message = ROLE_CODE_EMPTY)
    private String code;
    /**
     * 备注
     * @mock 备注
     */
    private String description;

    public SysRole(Long id, Integer enabled, Integer revision) {
        super(id, enabled, revision);
    }
}